package com.gitee.wsl.func.predicate

typealias Predicate2<T, U> = BiPredicate<T, U>

typealias LongBiPredicate = BiPredicate<Long, Long>

fun interface BiPredicate<T, U> {

    fun test(a: T, b: U): Boolean

    fun accept(a: T, b: U): Boolean = test(a,b)

    operator fun invoke(t: T, u: U) = test(t,u)

    fun negate(): BiPredicate<T, U> = object : BiPredicate<T, U> {
        override fun test(a: T, b: U): Boolean = !this@BiPredicate.test(a,b)
    }

}